﻿using Microsoft.Data.SqlClient;
using NetCoreDemo.Common.Help;
using NetCoreDemo.Models;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;

namespace NetCoreDemo.Services
{
    public class LoginSerives
    {

        public LoginModel GetData() 
        {
            string sql = "select Name,Age,Password from  Test_B_User";
            DataTable dt= MyUtils.ReadDataTable(sql);
            if (dt.Rows.Count > 0) 
            {
                return DataConvertModelHelper<LoginModel>.ToModel(dt) as LoginModel;//待改进
                 
            }
            else
            {
                return null;
            }
        }

    }

   
}
